<?php
$dbname = "rwc qualification";
$dbuser = "";
$dbpassword = "";
$dbi=odbc_connect($dbname, $dbuser, $dbpassword);
if(! $dbi ) echo "Impossible de se connecter";
/*
### voir toutes les tables
$tablelist = odbc_tables($dbi);
while (odbc_fetch_row($tablelist))
{
echo odbc_result_all($tablelist);
}


### voir juste les tables
echo"<br>";
$result = odbc_tables($dbi);

   $tables = array();
   while (odbc_fetch_row($result)){
     if(odbc_result($result,"TABLE_TYPE")=="TABLE")
       echo"<br>".odbc_result($result,"TABLE_NAME");

   }
echo"<br>";

### voir les colonnes
$tablelist = odbc_columns($dbi);
while (odbc_fetch_row($tablelist))
{
echo odbc_result_all($tablelist);
}
*/



$valeur= odbc_exec( $dbi, "select*from super_liga");
         while( odbc_fetch_row( $valeur ) ){
         echo odbc_result($valeur,1)." ".odbc_result($valeur,2)." ".odbc_result($valeur,4)." ".odbc_result($valeur,3)."<br> ";
         }





$valeur= odbc_exec( $dbi, "select*from matchs");
         while( odbc_fetch_row( $valeur ) ){

                            $messages[$n]["date"]=odbc_result( $valeur, "date");
                              $messages[$n]["Team 1"]=odbc_result( $valeur, "Team 1");
                                $messages[$n]["Team 2"]=odbc_result( $valeur, "Team 2");
                                  $messages[$n]["Result"]=odbc_result( $valeur, "Result");
                                    $messages[$n++]["Venue"]=odbc_result( $valeur, "Venue");
                            #print_r($messages);
         }
         foreach($messages as $message ){
         echo $message["date"]." ".$message["Team 1"]." ".$message["Result"]." ".$message["Team 2"]." ".$message["Venue"]."<br><br> ";
         }

?>